package com.EAsystem.entity;


public class Attendance {
    public static final int STATUS_ABSENT = 0;      // 缺勤
    public static final int STATUS_PRESENT = 1;     // 正常
    public static final int STATUS_LEAVE = 2;       // 请假
    public static final int STATUS_LATE = 3;        // 迟到
    public static final int STATUS_EARLY_LEAVE = 4; // 早退
    
    private Long id;
    private Student student;
    private Course course;
    private Integer status;  // 0:缺勤 1:正常 2:请假 3:迟到 4:早退
    private String date;
    private String createTime;
    private String updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
    
    /**
     * 获取状态名称
     * @return 状态名称
     */
    public String getStatusName() {
        if (status == null) {
            return "未知";
        }
        switch (status) {
            case STATUS_ABSENT:
                return "缺勤";
            case STATUS_PRESENT:
                return "正常";
            case STATUS_LEAVE:
                return "请假";
            case STATUS_LATE:
                return "迟到";
            case STATUS_EARLY_LEAVE:
                return "早退";
            default:
                return "未知";
        }
    }
}